<?php
/* [DoYouHaoBaby!] (C)Dianniu From 2010.
   this($)*/

!defined('DYHB_PATH') && exit;

class TemplateGtkGladeObj extends TemplateObj{

	private $_arrPropertys=array();

	public function addProperty(TemplateGtkGladeWidgetProperty $oProperty){
		$this->_arrPropertys[ $oProperty->getName()]=$oProperty;
	}

	public function clearProperty(){
		$nCount=$this->_arrPropertys;
		$this->_arrPropertys=array();
		return $nCount;
	}

	public function getProperty($sPropertyName,$sWhat=''){
		if(!isset($this->_arrPropertys[$sPropertyName])){return null;}
		if($sWhat==''){return $this->_arrPropertys[$sPropertyName]->getValue();}
		else{return $this->_arrPropertys[$sPropertyName]->get($sWhat);}
	}

	static public function nodeTextToValue($sText){
		if(in_array(strtolower($sText),array('yes','true','1','on'))){return true;}
		if(in_array(strtolower($sText),array('no','false','0','off'))){return false;}
		return $sText;
	}

}
